package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.domain.Department;
import cn.wolfcode.crm.domain.Menu;
import cn.wolfcode.crm.service.IDepartmentService;
import cn.wolfcode.crm.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("menu")
public class MenuController {

    @Autowired
    IMenuService menuService;


    @RequestMapping("selectRootMenu")
    @ResponseBody
    public List<Menu> selectRootMenu() {
        return menuService.selectRootMenu();
    }


    @RequestMapping("selectByRoleId")
    @ResponseBody
    public List<Long> selectByRoleId(Long roleId) {
        return menuService.selectByRoleId(roleId);
    }

    @RequestMapping("selectEmployeeMenu")
    @ResponseBody
    public List<Menu> selectEmployeeMenu() {
        return menuService.selectEmployeeMenu();
    }

}

